﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Invoice.aspx.cs" Inherits="Stock_Invoice"  MasterPageFile="../MasterPage.master" %>
<%@ OutputCache Duration="2" SqlDependency="CIM.Net:Dat_Stock" VaryByParam="none" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="Common" %>
<%@ Import Namespace="DAL" %>

<%@ Register src="../common/Pager.ascx" tagname="Pager" tagprefix="uc2" %>

<%@ Register src="Stock_Left.ascx" tagname="Stock_Left" tagprefix="uc3" %>

<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table cellpadding="0" cellspacing="2" width="100%" border="0">
	<tr>
        <td class="leftTd"  valign="top" width="20%">
            <uc3:Stock_Left ID="Stock_Left1" runat="server" />
        </td>
		<td width="80%" valign="top">
		<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center">
			<tr>
		        <td class="leftTd"  valign="top">
		        <table cellpadding="0" cellspacing="0" width="100%" border="0" align="center">
		        	<tr>
		            	<td class="titleStyle"><%= WebUtility.GetTitleByMenu(MenuType) %></td>
		            </tr>
		        </table>
		         <br />
		          <table width="98%" border="0" cellpadding="0" cellspacing="1" align="center" bgcolor="#000066">
	                <tr>
		                <td style="height: 30px;" class="banma22_1">&nbsp;客户名称：<asp:TextBox ID="CustName" 
                                runat="server" Width="60px" CssClass="face"></asp:TextBox>&nbsp;&nbsp;关键字：<asp:TextBox ID="Keyword" runat="server" Width="60px" CssClass="face"></asp:TextBox>&nbsp;&nbsp;
	                        <asp:TextBox ID="OneDate" runat="server" Width="70px" CssClass="face" Text="选择开始日期"></asp:TextBox>
	                        &nbsp;&nbsp;<asp:TextBox ID="TwoDate" runat="server" Width="70px" CssClass="face" Text="选择结束日期"></asp:TextBox>&nbsp;&nbsp;
                            <asp:Button ID="submit" runat="server" Text=" 搜 索 " CssClass="button" 
                                onclick="submit_Click" />&nbsp;
                            <asp:Button ID="submit0" runat="server" Text=" 导 出 " CssClass="button" 
                                onclick="submit0_Click" />
		                </td>
	                </tr>
                    </table><br/>
                    <asp:ListView ID="lv_Invoice" runat="server" ondatabound="lv_Invoice_DataBound" 
                        onitemdeleting="lv_Invoice_ItemDeleting" DataKeyNames="InvoiceKey" >
                       <LayoutTemplate>
                            <table id="table1"  runat="server" width="98%" border="0" cellpadding="0" cellspacing="1" align="center" bgcolor="#000066">
                              <tr>
                                <td style="height: 25px; width: 5%;" class="banma1 TextCenters">序号</td>
                                <td style="height: 25px; width: 10%;" class="banma1 TextCenters">预约序号</td>
                                <td style="height: 25px; width: 10%;" class="banma1 TextCenters">发票号码</td>
                                <td style="height: 25px; width: 15%;" class="banma1 TextCenters">客户名称</td>
                                <td style="height: 25px; width: 15%;" class="banma1 TextCenters">发票内容</td>
		                        <td style="height: 25px; width: 9%;" class="banma1 TextCenters">开票日期</td>
		                        <td style="height: 25px; width: 8%;" class="banma1 TextCenters">金额</td>
		                        <td style="width: 10%;" class="banma1 TextCenters">送达日期</td>
		                        <td style="width: 7%;" class="banma1 TextCenters">经手人</td>
 	                            <td style="width: 12%;" class="banma1 TextCenters">操作</td>
	                          </tr>
                              <tr id="itemPlaceholder" runat="server" ></tr><br />
                            </table>
                       </LayoutTemplate>
                       <ItemTemplate>
                           <tr>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Container.DataItemIndex+1 %></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;">
                            <a class="thickbox" href="../Business/Business_View.aspx?DanNum=<%# Eval("DanNum") %>&KeepThis=true&TB_iframe=true&height=550&width=650">
                            <%# Eval("DanNum")%></a></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Eval("InvoiceNO")%></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Eval("CustName")%></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Eval("InvoiceContent")%></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Convert.ToDateTime(Eval("InvoiceDate")).ToString("yyyy-MM-dd")%></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Eval("InvoicePrice")%></td>
		                    <td class="banma22_2" style="height: 25px; text-align: center;"><%# Eval("ArriveDate")==null?"":Convert.ToDateTime(Eval("ArriveDate")).ToString("yyyy-MM-dd")%></td>
		                    <td class="banma22_2" style="height: 25px; text-align: center;"><%# new Account().GetAccountName(Eval("MUserKey")) %></td>
	                        <td class="banma22_2" style="height: 25px; text-align: center;">
	                        <a href='Invoice_Add.aspx?menutype=331&invoicekey=<%# Eval("InvoiceKey") %>'>修改</a>
	                        <% if (UserType==4) { %>
	                        <asp:LinkButton ID="Delete" runat="server" CommandName="delete"  OnClientClick="return confirm('确认要删除吗？');">删除</asp:LinkButton>
	                        <% } %>
	                        </td>
	                       </tr> 
                      </ItemTemplate>
                       <AlternatingItemTemplate>
                           <tr>
                            <td class="banma22_1" style="height: 25px; text-align: center;"><%# Container.DataItemIndex+1 %></td>
                            <td class="banma22_1" style="height: 25px; text-align: center;">
                            <a class="thickbox" href="../Business/Business_View.aspx?DanNum=<%# Eval("DanNum") %>&KeepThis=true&TB_iframe=true&height=550&width=650">
                            <%# Eval("DanNum")%></a></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Eval("InvoiceNO")%></td>
                            <td class="banma22_1" style="height: 25px; text-align: center;"><%# Eval("CustName")%></td>
                            <td class="banma22_2" style="height: 25px; text-align: center;"><%# Eval("InvoiceContent")%></td>
                            <td class="banma22_1" style="height: 25px; text-align: center;"><%# Convert.ToDateTime(Eval("InvoiceDate")).ToString("yyyy-MM-dd")%></td>
                            <td class="banma22_1" style="height: 25px; text-align: center;"><%# Eval("InvoicePrice")%></td>
		                    <td class="banma22_1" style="height: 25px; text-align: center;"><%# Eval("ArriveDate")==null?"":Convert.ToDateTime(Eval("ArriveDate")).ToString("yyyy-MM-dd")%></td>
		                    <td class="banma22_1" style="height: 25px; text-align: center;"><%# new Account().GetAccountName(Eval("MUserKey")) %></td>
	                        <td class="banma22_1" style="height: 25px; text-align: center;">
	                        <a href='Invoice_Add.aspx?menutype=331&invoicekey=<%# Eval("InvoiceKey") %>'>修改</a>
	                        <% if (UserType==4) { %>
	                        <asp:LinkButton ID="Delete" runat="server" CommandName="delete"  OnClientClick="return confirm('确认要删除吗？');">删除</asp:LinkButton>
	                        <% } %>
	                        </td>
	                       </tr> 
                      </AlternatingItemTemplate>
	                  </asp:ListView>
	                   <!-- Page Begin --><asp:DataPager ID="DataPager1" runat="server" PagedControlID="lv_Invoice" PageSize="20">
                                   <Fields>
                                    <asp:TemplatePagerField>
                                         <PagerTemplate>
                              
                              <table width="96%" border="0" cellpadding="0" cellspacing="0" align="center">
                                <tr>
                                    <td width="36%" height="30">
                                        页次：<b><%# WebUtility.GetCurrentPage(Container.StartRowIndex, Container.PageSize)%></b>/<b><%# WebUtility.GetTotalPage(Container.TotalRowCount, Container.PageSize)%></b>页 
                                        每页<b><%# Container.PageSize  %></b>条 共<b><%# Container.TotalRowCount %></b>条
                                    </td>
                                    <td width="64%" height="30" style="text-align: right;">
                                        分页：
                                        </PagerTemplate>
                                     </asp:TemplatePagerField>
                                     <asp:NextPreviousPagerField ButtonType="Image" FirstPageImageUrl="../images/first.gif" ShowFirstPageButton="true" ShowNextPageButton="false" ShowPreviousPageButton="false" />
                                     <asp:NumericPagerField CurrentPageLabelCssClass="SelectedPage" NumericButtonCssClass="NotSelectedPage" />
                                     <asp:NextPreviousPagerField ButtonType="Image" LastPageImageUrl="../images/last.gif"  ShowLastPageButton="true" ShowNextPageButton="false" ShowPreviousPageButton="false" />
                                     <asp:TemplatePagerField>
                                        <PagerTemplate>
                                               转到：
                                            <asp:DropDownList ID="PageList" runat="server" AutoPostBack="true" 
                                                onselectedindexchanged="PageList_SelectedIndexChanged" >
                                            </asp:DropDownList>
                                                </td>
                                            </tr>
                                        </table>
                                         </PagerTemplate>
                                     </asp:TemplatePagerField>
                                   </Fields>
                        </asp:DataPager>
                        <!-- Page End -->
        </td>
    </tr>
</table>
</asp:Content>

